package cn.com.huzo.model.entities.inventory;

import huzofw.model.entities.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import huzofw.model.entities.IAggregateRoot;
import java.io.Serializable;
import java.sql.Timestamp;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 入库单明细-本次引入的采购订单主表记录实体类
 * <p>
 * @author 吴旭
 */
public class StockInLinesPoHeaderEntity extends BaseEntity implements Serializable, IAggregateRoot {

    private static final long serialVersionUID = -2523213827503483309L;
    private String LinesId;
    private Long HeaderId;                    // 所属入库单标识
    private Long PoHeaderId;                  // 引入的采购订单标识
    private String PoNo;                      // 合同号
    private String PoBillTypeName;            // 合同类型
    private String SupplierName;              // 供应商名
    private Timestamp SignedDate;             // 落单日期
    private Timestamp OrderArrivalDate;       // 到货日期
    private String PurchasedByName;           // 采购担当

    public String getLinesId() {
        return LinesId;
    }

    public Long getHeaderId() {
        return HeaderId;
    }

    public Long getPoHeaderId() {
        return PoHeaderId;
    }

    public String getPoNo() {
        return PoNo;
    }

    public String getPoBillTypeName() {
        return PoBillTypeName;
    }

    public String getSupplierName() {
        return SupplierName;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Timestamp getSignedDate() {
        return SignedDate;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Timestamp getOrderArrivalDate() {
        return OrderArrivalDate;
    }

    public String getPurchasedByName() {
        return PurchasedByName;
    }

    public void setLinesId(String LinesId) {
        this.LinesId = LinesId;
    }

    public void setHeaderId(Long HeaderId) {
        this.HeaderId = HeaderId;
    }

    public void setPoHeaderId(Long PoHeaderId) {
        this.PoHeaderId = PoHeaderId;
    }

    public void setPoNo(String PoNo) {
        this.PoNo = PoNo;
    }

    public void setPoBillTypeName(String PoBillTypeName) {
        this.PoBillTypeName = PoBillTypeName;
    }

    public void setSupplierName(String SupplierName) {
        this.SupplierName = SupplierName;
    }

    public void setSignedDate(Timestamp SignedDate) {
        this.SignedDate = SignedDate;
    }

    public void setOrderArrivalDate(Timestamp OrderArrivalDate) {
        this.OrderArrivalDate = OrderArrivalDate;
    }

    public void setPurchasedByName(String PurchasedByName) {
        this.PurchasedByName = PurchasedByName;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof StockInLinesPoHeaderEntity)) {
            return false;
        }

        final StockInLinesPoHeaderEntity that = (StockInLinesPoHeaderEntity) o;

        return new EqualsBuilder()
                .append(this.getLinesId(), that.getLinesId())
                .isEquals();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int hashCode() {
        int result = 17;
        result = 31 * result + getLinesId().hashCode();

        return result;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
